package leetcode.每日一题;

import org.junit.Test;

/**
 * @author ：zsy
 * @date ：Created 2023/1/5 9:31 PM
 * @description：
 */
public class 统计异或值在范围内的数对有多少 {
    @Test
    public void test() {

    }

    class Solution {
        public int countPairs(int[] nums, int low, int high) {
            int cnt = 0;
            for (int i = 0; i < nums.length; i++) {
                for (int j = i + 1; j < nums.length; j++) {
                    int ans = nums[i] ^ nums[j];
                    if (ans >= low && ans <= high) {
                        cnt++;
                    }
                }
            }
            return cnt;
        }
    }
}
